<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="patientEncounter" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <h:panelGrid columns="1" >
            <!--<h:outputLabel value="Company Name : " style="min-width: 100px;"  />-->  
            <p:autoComplete id="acCreditCompany" forceSelection="true" style="text-align: right;"
                            value="#{cc.attrs.patientEncounter.creditCompany}"  
                            completeMethod="#{creditCompanyController.completeCredit}" 
                            var="ix" itemLabel="#{ix.name}" 
                            itemValue="#{ix}" size="30" >  
                <f:ajax event="itemSelect" execute="@this" render=":#{p:component('panelCompanyDesc')}" ></f:ajax>
            </p:autoComplete>
            <!--<h:outputLabel value="Credit Limit : " style="min-width: 100px;" />-->
            <p:inputText id="creditLimit" autocomplete="off" value="#{cc.attrs.patientEncounter.creditLimit}" />
            <h:outputLabel value="Description "  rendered="#{cc.attrs.patientEncounter.creditCompany ne null}" />                            
            <h:outputText id="panelCompanyDesc"  
                          rendered="#{cc.attrs.patientEncounter.creditCompany ne null}" 
                          value="#{cc.attrs.patientEncounter.creditCompany.descreption}" />
            <!--<h:outputLabel value="Ploicy Number : " style="min-width: 100px;" />-->
            <p:inputText id="pno" autocomplete="off" value="#{cc.attrs.patientEncounter.policyNo}" />
            <!--<h:outputLabel value="Referance Number : " style="min-width: 100px;" />-->
            <p:inputText id="rno" autocomplete="off" value="#{cc.attrs.patientEncounter.referanceNo}" />
<!--            <p:outputLabel value="Credit Paid By Credit company" rendered="#{webUserController.hasPrivilege('Developers')}"/>
            <p:inputText value="#{bhtEditController.current.paidByCreditCompany}" rendered="#{webUserController.hasPrivilege('Developers')}"></p:inputText>
            <p:outputLabel value="Credit Paid Amount" rendered="#{webUserController.hasPrivilege('Developers')}"/>
            <p:inputText value="#{bhtEditController.current.creditPaidAmount}" rendered="#{webUserController.hasPrivilege('Developers')}"></p:inputText>
            <p:outputLabel value="Credit Used Amount" rendered="#{webUserController.hasPrivilege('Developers')}"/>
            <p:inputText value="#{bhtEditController.current.creditUsedAmount}" rendered="#{webUserController.hasPrivilege('Developers')}"></p:inputText>-->
        
            <p:watermark value="Company Name" for="acCreditCompany" />
            <p:watermark value="Credit Limit" for="creditLimit" />
            <p:watermark value="Policy Number" for="pno" />
            <p:watermark value="Reerance Number" for="rno" />
        </h:panelGrid>
    </cc:implementation>
</html>